package com.dahua.messagesyncsh.business.mitsubishi.http;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.UUID;

/**
 * @author HJJ
 * @date 2022/10/14/10:02
 * Desc:
 */
@Getter
@Setter
@AllArgsConstructor
public class ApiServiceResponse<T> implements Serializable {

    private static final long serialVersionUID = 1L;
    //状态码
    private String code;
    //文字描述
    private String message;
    //总数
    private Long total;
    //数据
    private T data;
    //响应标识
    private String requestid;

    public ApiServiceResponse() {
        this(null, null, null, null, UUID.randomUUID().toString().replaceAll("-", ""));
    }

    public ApiServiceResponse<T> total(Long total) {
        this.total = total;
        return this;
    }
}